package com.jack.cms.ueditor.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jack.cms.core.support.HttpKit;
import com.jack.cms.ueditor.ActionEnter;

@Controller
@RequestMapping("ueditor")
public class UeditorController {
	private static Logger logger =  LoggerFactory.getLogger(UeditorController.class);
	
	@RequestMapping(value = "api")
	public void api(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String rootPath=request.getSession().getServletContext().getRealPath("/");
		String result = new ActionEnter(request, rootPath).exec();
		logger.info(result);
		// 解决ResponseBody返回值有转义符号问题 
		HttpKit.write(result);
	}
}
